import request from '@/utils/http'
import { BaseResult } from '@/types/axios'

export class CustomerService {
  // 顾客列表
  static getCustomerPage(params?: object) {
    return request.get<BaseResult>({
      url: '/customer/customer/page',
      params
    })
  }
  // 顾客详情
  static getCustomerDetail(params: object) {
    return request.get<BaseResult>({
      url: '/customer/customer/info',
      params
    })
  }
  // 顾客标签列表
  static getCustomerTagList(params: object) {
    return request.get<BaseResult>({
      url: '/customer/customer/tag/list',
      params
    })
  }
  // 获取顾客属性列表
  static getCustomerFieldList(params: object) {
    return request.get<BaseResult>({
      url: '/customer/customer/field/list',
      params
    })
  }
  // 给顾客打标签
  static customerTagAdd(params: object) {
    return request.post<BaseResult>({
      url: '/customer/customer/tag/add',
      data: params
    })
  }
  // 删除顾客标签
  static customerTagDelete(params: object) {
    return request.post<BaseResult>({
      url: '/customer/customer/tag/delete',
      data: params
    })
  }
  // 添加顾客属性
  static customerFieldAdd(params: object) {
    return request.post<BaseResult>({
      url: '/customer/customer/field/add',
      data: params
    })
  }
  // 更新顾客属性
  static customerFieldUpdate(params: object) {
    return request.post<BaseResult>({
      url: '/customer/customer/field/update',
      data: params
    })
  }
  // 删除顾客属性
  static customerFieldDelete(params: object) {
    return request.post<BaseResult>({
      url: '/customer/customer/field/delete',
      data: params
    })
  }
  // 分页获取顾客操作记录列表
  static getOperateLog(params: object) {
    return request.get<BaseResult>({
      url: '/customer/operate_log/page_operate_logs',
      params
    })
  }
}